package com.suitsoft.bdms.commos;

import java.util.List;
import java.util.Map;
import java.util.Timer;

import javax.servlet.ServletContext;

import com.suitsoft.logback.H2Logback;

/**
 * 自定义应用程序配置类.
 * 
 * 该类在项目运行过程中只保存一个实例.
 *  
 * @author Suineg
 */
public class AppConfig {
	private static AppConfig sp = null;

	private Map<String,String> logConfig ;
	
	private int pageSize;
	
	private H2Logback logback;
	
	private ServletContext application;
	
	private List<Timer> timerList;

	/**
	 * 私有构造器.
	 */
	private AppConfig() {
	}

	/**
	 * 取得本类实例的方法. 
	 */
	public static AppConfig getInstance() {
		if (sp == null) {
			sp = new AppConfig();
		}

		return sp;
	}

	public Map<String, String> getLogConfig() {
		return logConfig;
	}

	public void setLogConfig(Map<String, String> logConfig) {
		this.logConfig = logConfig;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public H2Logback getLogback() {
		return logback;
	}

	public void setLogback(H2Logback logback) {
		this.logback = logback;
	}

	public ServletContext getApplication() {
		return application;
	}

	public void setApplication(ServletContext application) {
		this.application = application;
	}

	public List<Timer> getTimerList() {
		return timerList;
	}

	public void setTimerList(List<Timer> timerList) {
		this.timerList = timerList;
	}
}
